import {req_get, req_get_auth, req_post_auth} from "./baseApi.js";
import {HOST} from './hosts'

export const getUserInfo = (params) => {
    const url = `${HOST}/users/userInfo`
    return req_get_auth("get", url, params);
};

export const addTrip = (data) => {
    const url = `${HOST}/trip/create`
    return req_post_auth("post", url, data);
};

export const getTripList = (params) => {
    const url = `${HOST}/trip/list`
    return req_get_auth("get", url, params);
};

// 司机开始行程
export const startTrip = (data) => {
    const url = `${HOST}/trip/start`
    return req_post_auth("put", url, data);
};
// 司机结束行程
export const endTrip = (data) => {
    const url = `${HOST}/trip/end`
    return req_post_auth("put", url, data);
};

// 司机确认已经返程
export const returnedAAA = (data) => {
    const url = `${HOST}/users/returned`
    return req_post_auth("put", url, data);
};
